<% cache([reply, reply.user_avatar_raw, "raw:#{@show_raw}"]) do %>
<%
  floor = reply_counter + 1
  show_deleted = reply.deleted? && !@show_raw
  class_names = ['reply']
  class_names << 'popular' if reply.popular?
  class_names << 'reply-system' if reply.system_event?
  class_names << 'reply-deleted' if show_deleted
%>
<div class="<%= class_names.join(' ') %>" data-id="<%= reply.id %>" id="reply<%= floor %>">
  <div id="reply-<%= reply.id %>" data-floor="<%= floor %>">
    <% if show_deleted %>
      <div class="deleted text-center"><%= floor %><%= t("common.floor")%> <%= t("common.has_deleted")%></div>
    <% elsif reply.system_event? %>
      <%= render '/replies/system_event', reply: reply %>
    <% else %>
      <div class="avatar"><%= user_avatar_tag(reply.user, :md) %></div>
      <div class="infos">
        <div class="info">
          <span class="name">
            <%= user_name_tag(reply.user) %>
          </span>
          <span class="sub-info">
            <span class='floor'>#<%= floor %></span> ·
            <a class="time" href="#reply-<%= reply.id %>"><%= timeago(reply.created_at) %></a>
          </span>
          <span class="opts pull-right">
            <% if !reply.deleted? %>
              <span class="hideable">
              <%= link_to('', edit_topic_reply_path(@topic,reply), class: "edit fa fa-pencil", 'data-uid' => reply.user_id, title: "修改回帖")%>
              <%= link_to('', "#", 'data-id' => reply.id, 'data-login' => reply.user_login,
                  title: t("topics.reply_this_floor"), class: "btn-reply fa fa-mail-reply" )
              %>
              </span>
              <%= likeable_tag(reply, cache: true) %>
            <% end %>
          </span>
        </div>
        <%= render 'replies/reply_to', reply: reply, show_body: false %>
        <div class="markdown<%= ' deleted' if reply.deleted? %>">
          <%= reply.body_html %>
        </div>
      </div>
    <% end %>
  </div>
</div>
<% end %>
